/**
 * 
 */
package net.toocruel.iqismart.service;

import net.toocruel.iqismart.dao.condition.UserCondition;
import net.toocruel.iqismart.entity.constants.NotificationType;
import net.toocruel.iqismart.entity.core.Credit;
import net.toocruel.iqismart.entity.rbac.User;
import net.toocruel.iqismart.service.dto.ProfileBaseDTO;
import net.toocruel.iqismart.service.dto.ProfileEmailDTO;
import net.toocruel.iqismart.service.dto.ProfilePasswordDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * 管理员服务
 * 
 * @author toocruel
 *
 */
public interface UserService {

	/**
	 * 创建用户
	 */
	User create(User user);
	/**
	 * 修改用户
	 */
	User update(User user);
	/**
	 * 删除用户
	 */
	void delete(Long id);

	/**
	 * 批量删除用户
	 * @param id
	 * @return
	 */
	int deleteMany(Long[] id);
	/**
	 * 分页查询用户
	 */
	Page<User> 	query(UserCondition condition, Pageable pageable);

	int verify(Long id);
	int verifyMany(Long[] id);

	User findById(Long id);

	/**
	 * 全加载
	 * @param id
	 * @return
	 */
	User getById(Long id);

    List<User> findAll();

	List<User> getHotUsers();

	void addCredit(Long userId, int count);

	void addCoin(Long userId, int count);

	void addCredit(Credit credit);

	void updateAdoptPercent(Long userId);

    List<User> getMostCoinUsers(int count);

    User register(User user);

    User getByUsername(String username);

    void updateProfileBase(Long id, ProfileBaseDTO dto);

	String corpAvatar(Long id, int x, int y, int width, int height);

	void updateProfilePassword(Long id, ProfilePasswordDTO dto);

    void updateProfileEmail(Long id, ProfileEmailDTO dto);

    String sendEmailToken(Long id);

	void updateProfileNotification(Long uid, NotificationType[] emailNotifications, NotificationType[] siteNotifications);
}
